package com.alt.www.io;

import java.io.FileReader;

/**
 * Created by 27340 on 2017/9/3.
 */
public class FileReaderDemo
{
    public static void main(String[] args) {
        try {
            FileReader reader = new FileReader("e://hello.txt");
            char[] buffer = new char[3];
            while (true){
                int length = reader.read(buffer);
                if(length==-1){
                    break;
                }else{
                    System.out.println(length);
                    System.out.println(buffer.length);
                    for (int i = 0; i < length; i++) {
                        System.out.println(buffer[i]);
                    }
                    System.out.println(buffer.length);
                    System.out.println(new String(buffer));
                    System.out.println("------------");
                }
            }
        }catch (Exception e){

        }
        char[] chars = new char[3];
        char a  = 's';
        chars[0] = a;
        chars[1] = 'b';
        System.out.print(new String(chars));
    }
}
